package com.zyl;

import com.zyl.factory.FactoryInstance;
import com.zyl.server.Server;
/**
 * @version v1.0
 * @ProjectName: env_gather
 * @Package: com.zyl
 * @ClassName: Main
 * @Description TODO()
 * @Author 翟玉龙
 * @Date 2024/10/21-10:30
 */
public class ServerMain {
    public static void main(String[] args) {
        try {
            Server server = FactoryInstance.init().getInstance("server", Server.class);
            if (server != null) {
                server.receive();
            }
        } catch (Exception e) {
            if("Socket closed".equals(e.getMessage())) {
                System.err.println("服务器已经关闭");
            } else {
                System.err.println("出现异常：" + e.getMessage());
            }
        }
    }
}
